package com.gz.mylife.util;

import java.lang.reflect.Field;

import com.gz.mylife.widget.SmoothViewPagerScroller;

import android.support.v4.view.ViewPager;

public class ViewUtils {

	public static void SmoothViewPagerScrollerMaker(ViewPager viewpager) {
		try {
			Field mScroller;
			mScroller = ViewPager.class.getDeclaredField("mScroller");
			mScroller.setAccessible(true);
			SmoothViewPagerScroller smooth = new SmoothViewPagerScroller(
					viewpager.getContext());
			mScroller.set(viewpager, smooth);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
